<template>
  <el-table
    ref="multipleTable"
    :data="tableData"
    style="width: 100%;"
    max-height="500px"
    :size="detailSize"
    stripe
    class="table-list table-fxied-height"
  >
    <el-table-column type="index" label="序号" width="51" align="center" />
    <el-table-column
      prop="equipmentModel"
      label="设备型号"
      min-width="120"
      align="center"
      :show-overflow-tooltip="true"
    />
    <el-table-column
      prop="equipmentNum"
      label="设备类型"
      min-width="120"
      align="center"
      :show-overflow-tooltip="true"
    />
    <el-table-column
      prop="equipmentNum"
      label="设备编号"
      min-width="120"
      align="center"
      :show-overflow-tooltip="true"
    />
    <el-table-column
      prop="orgCreditCode"
      label="产权单位信用代码"
      min-width="160"
      align="center"
      :show-overflow-tooltip="true"
    />
  </el-table>
</template>

<script>
// 页面接口
import { getAllocatedDevices } from '@/api/projectManage/project'
import { fixedEquipmentType } from '@/api/superviseBaseInfo/typeManage/equipmentType/index'
export default {
  name: 'AssignedPersonnel',
  props: {
    proId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      tableData: [],
      typeOptions: []
    }
  },
  watch: {
    proId: {
      immediate: true,
      handler(value) {
        value && this.getList(value)
      }
    }
  },
  mounted() {
    this.getSupperType()
  },
  methods: {
    // 获取列表
    async getList(proId) {
      const { data } = await getAllocatedDevices(proId)
      console.log(1)
      this.tableData = data
    },
    // 获取人员类型
    async getSupperType() {
      const { data: { rows }} = await fixedEquipmentType()
      this.typeOptions = rows
    }
  }
}
</script>

<style lang='scss' scoped>
.table-fxied-height {
  max-height: 396px; // 最多10条数据
  overflow-y: scroll;
}
</style>
